package com.shsun.curveservice;

//import com.feiniaojin.gracefulresponse.EnableGracefulResponse;
import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.core.env.Environment;
import org.springframework.scheduling.annotation.EnableAsync;

import java.util.Optional;
import java.util.TimeZone;

@Slf4j
@EnableAsync
@SpringBootApplication
@MapperScan("com.shsun.curveservice.repository")
//@EnableGracefulResponse
@ComponentScan({"com.shsun"})
public class CurveServiceApplication {

    public static void main(String[] args) {
        TimeZone.setDefault(TimeZone.getTimeZone("Asia/Shanghai"));
        ConfigurableApplicationContext context = SpringApplication.run(CurveServiceApplication.class, args);
        Environment environment = context.getBean(Environment.class);
        log.info("************** SERVER STARTED ******************");
        String url = "http://localhost:" + environment.getProperty("local.server.port")
                + Optional.ofNullable(environment.getProperty("server.servlet.context-path")).orElse("") + "/doc.html";
        log.info("Please browse:" + url);
        log.info("===========================遗忘曲线服务启动成功！！！=====================================");
    }

}
